
//mini-vue的出口

export * from './runtime-dom';


import { baseCompile } from './compiler-core/src';
import * as runtimDom from "./runtime-dom";
import { registerRuntimeCompiler } from "./runtime-dom";

function compileToFunction(template) {
    const { code } = baseCompile(template);
    const render = new Function("Vue",code)(runtimDom);
    return render;
    // const render = renderFunction()
    // function renderFunction(Vue) {
    //     const { toDisplayString: _toDisplayString, createElementVNode: _createElementVNode } = Vue
    //     return function render(_ctx, _cache) { return _createElementVNode('div', null, 'hi,' + _toDisplayString(_ctx.message)) }
    // }
    
}

registerRuntimeCompiler(compileToFunction);